<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="bean.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="dao.*" %>
<%@ page import="java.util.Iterator" %>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8" />
		<title>成绩录入</title>
		<link type="text/css" rel="stylesheet" href="css/index.css">
		<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
	</head>
	<body>
		<%
			//Student s = (Student)request.getSession().getAttribute("student");
			Customer c = (Customer) request.getSession().getAttribute("teacher");
			if(c == null){
				response.sendRedirect("Not_Login.jsp");
			}
		%>
		<div class="main">
			<div class="navigation">
				<span>欢迎回来! 
					<%
						if(c != null){
							out.print(c.getName());
						}
					%>
					老师
				</span>
				<a class="exit" href="index.jsp"><span>退出登录</span></a>
			</div>
			<table class="table" style="margin:0 auto;width:90%">
				<tr>
					<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='index_Teacher.jsp'">公告</button>	</td>
					<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Student_Data.jsp'">毕设相关</button></td>
					<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Manage_Grades.jsp'">成绩录入</button></td>
					</tr>
			</table>
			<div>
				<%
					String Name = c.getName();
					ArrayList<Score> list = TeacherSql.GetScore(Name);
					Score score = null;
				%>
				<table class="table table-hover; table_center" style="margin:0 auto;width:90% ;color: white">
					<tr>
						<th>学号</th><th>学生姓名</th><th>题目</th><th>评分</th><th>等级</th>
					</tr>
					<%
						if(list != null){
							Iterator<Score> iterator = list.iterator();
							while(iterator.hasNext()){
								score = iterator.next();
					%>
					<tr>
						<td><%=score.getID() %></td>
						<td><%=score.getName() %></td>
						<td><%=score.getTitle() %></td>
						<td><%=score.getSocre() %></td>
						<td><%=score.getGrade() %></td>
						<td><button class="btn btn-default btn-sm" ><a href="Alter_Score.jsp?ID=<%=score.getID() %>">录入成绩</a></button>
					</tr>
					<%
							}
						}else{
							
						}
					%>
				</table>
			</div>
			<div class="clear"></div>			
		</div>

	</body>
</html>
